import { createMemoryHistory, createWebHistory, createRouter } from 'vue-router'

import App from '@/App.vue'

const routes = [
    { path: '/', redirect: '/page' },
    { path: '/page', component: () => import('@/views/pageView.vue') },
    { path: '/page2', component: () => import('@/views/pageView2.vue') },
    {
        path: '/live',
        name: 'Live',
        component: () => import('@/views/live/WebRTCLive.vue')
    },
    {
        path: '/watchLive/:roomId?',
        name: 'Watch',
        component: () => import('@/views/watchLive/WatchLive.vue')
    },
    {
        path: '/h5WatchLive/:roomId?',
        name: 'h5WatchLive',
        component: () => import('@/views/watchLive/H5WatchLive.vue')
    }
]

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes,
})

export default router